package com.leyou.gateway.scheduler;

import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import java.util.Date;

/**
 * @date: 2021/4/12 0012 15:00
 * @description: 定时任务类
 */
@Component
public class SchedulingDemo {
    /**
     * 固定任务
     */
    /*@Scheduled(fixedRate = 5000)
    public void rateJob() {
        System.out.println("固定频率任务 = " + new Date());
    }*/

    /**
     * 日历任务
     */
    /*@Scheduled(cron = "0/5 * * * * ?")
    public void  cronJob() {
        System.out.println("日历任务 = " + new Date());
    }*/
}
